import { faker } from "@faker-js/faker";
import { CommentType } from "@/types/home";

const commentList: CommentType[] = [
  {
    id: "1",
    image: "/image/cartoon/1.jpg",
    alt: "图片1",
    name: faker.person.fullName(),
    avatar: "/image/avatar/1.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "2",
    image: "/image/cartoon/2.jpg",
    alt: "图片2",
    name: faker.person.fullName(),
    avatar: "/image/avatar/2.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "3",
    image: "/image/cartoon/3.jpg",
    alt: "图片3",
    name: faker.person.fullName(),
    avatar: "/image/avatar/3.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "4",
    image: "/image/cartoon/4.jpg",
    alt: "图片4",
    name: faker.person.fullName(),
    avatar: "/image/avatar/4.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "5",
    image: "/image/cartoon/5.jpg",
    alt: "图片5",
    name: faker.person.fullName(),
    avatar: "/image/avatar/5.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "6",
    image: "/image/cartoon/6.jpg",
    alt: "图片6",
    name: faker.person.fullName(),
    avatar: "/image/avatar/6.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "7",
    image: "/image/cartoon/7.jpg",
    alt: "图片7",
    name: faker.person.fullName(),
    avatar: "/image/avatar/7.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "8",
    image: "/image/cartoon/8.jpg",
    alt: "图片8",
    name: faker.person.fullName(),
    avatar: "/image/avatar/8.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "9",
    image: "/image/cartoon/9.jpg",
    alt: "图片9",
    name: faker.person.fullName(),
    avatar: "/image/avatar/9.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "10",
    image: "/image/cartoon/10.jpg",
    alt: "图片10",
    name: faker.person.fullName(),
    avatar: "/image/avatar/10.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
  {
    id: "11",
    image: "/image/cartoon/11.jpg",
    alt: "图片11",
    name: faker.person.fullName(),
    avatar: "/image/avatar/11.jpg",
    content: faker.lorem.sentence({ min: 5, max: 40 }),
    date: "2025-01-21",
  },
];

export async function GET() {
  // const commentListTop5 = commentList.slice(0, 5);
  // 随机选取五条评论数据
  const shuffled = commentList.sort(() => Math.random() - 0.5);
  const commentListTop5 = shuffled.slice(0, 5);
  return Response.json(commentListTop5);
}
